<?php
defined('JPATH_BASE') or die;
//Mo ta hanh vi nguoi dung
class JFormFieldContentrating extends JFormField{
	protected $type = 'Contentrating';
	protected  function getInput(){
		if($this->element['size']){
			$attr=' size="'.(int)$this->element['size'].'"';
			
		}else{
			$attr='';
		}
		
		//Truy van bang du lieu
		$db = &JFactory::getDbo();
		$query = 'SELECT id AS value, name AS text FROM aas_content_rating';
		$db->setQuery($query);
		//JError::raiseWarning(100, 'Su dung');
		//Tao combobox
		return JHtml::_('select.genericlist',
					$db->loadObjectList(),
					$this->name, trim($attr));
	}
}